<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<style>
    #photo {
        max-width: 100%;
        max-height: 350px;
    }
</style>
<body class="hold-transition skin-red sidebar-mini">
<!--修改密码-->
<div class="modal fade" id="modal-updatePassword">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改密码</h4>
            </div>
            <div class="modal-body">
                <form id="userForm" class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="password" class="col-sm-2 control-label no-padding-right">新的密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="password" name="password"
                                   placeholder="请输入新密码">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="rePassword" class="col-sm-2 control-label no-padding-right">重复密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="rePassword" name="rePassword"
                                   placeholder="请再输入一次">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="btn-updatePassword">确定</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!--修改头像-->
<div class="modal fade" id="modal-upload">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改头像</h4>
            </div>
            <div class="modal-body">
                <p class="tip-info text-center">
                    未选择图片
                </p>
                <div class="img-container hidden">
                    <img src="" alt="" id="photo">
                </div>
                <div class="img-preview-box hidden">
                    <hr>
                    <span>150*150:</span>
                    <div class="img-preview img-preview-lg">
                    </div>
                    <span>100*100:</span>
                    <div class="img-preview img-preview-md">
                    </div>
                    <span>30*30:</span>
                    <div class="img-preview img-preview-sm">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <label class="btn btn-danger pull-left" for="photoInput">
                    <input type="file" class="sr-only" id="photoInput" accept="image/*">
                    <span>打开图片</span>
                </label>
                <button type="button" class="btn btn-info disabled" disabled id="btn-upload" onclick="sendPhoto()">确定
                </button>
                <p style="color:red;margin-top: 8px;margin-left: 20px" class="pull-left">比例 1 ：1 建议尺寸 300 x 300</p>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<div class="wrapper">

    <header class="main-header">
        <a class="logo">
            <span class="logo-lg"><b style="float:left">物资管理系统</b></span>
        </a>
        <nav class="navbar navbar-static-top">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" title="菜单缩放" role="button"></a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!--<li class="dropdown messages-menu">-->
                    <!--<a href="#" title="项目下达任务消息提示" class="dropdown-toggle" data-toggle="dropdown">-->
                    <!--<i class="fa fa-comment-o"></i>-->
                    <!--<span class="label label-danger" id="count-send"></span>-->
                    <!--</a>-->
                    <!--<ul class="dropdown-menu">-->
                    <!--<li><ul class="menu" id="unread-send"></ul></li>-->
                    <!--<li class="footer" id="no-send"><a href="javascript:void(0)">没有未读消息</a></li>-->
                    <!--</ul>-->
                    <!--</li>-->
                    <!--<li class="dropdown messages-menu">-->
                    <!--<a href="#" title="项目变更消息提示" class="dropdown-toggle" data-toggle="dropdown">-->
                    <!--<i class="fa fa-bell-o"></i>-->
                    <!--<span class="label label-danger" id="count-change"></span>-->
                    <!--</a>-->
                    <!--<ul class="dropdown-menu">-->
                    <!--<li><ul class="menu" id="unread-change"></ul></li>-->
                    <!--<li class="footer" id="no-change"><a href="javascript:void(0)">没有未读消息</a></li>-->
                    <!--</ul>-->
                    <!--</li>-->
                    <!--<li class="dropdown messages-menu">-->
                    <!--<a href="#" title="互动专区消息提示" class="dropdown-toggle" data-toggle="dropdown">-->
                    <!--<i class="fa fa-envelope-o"></i>-->
                    <!--<span class="label label-danger" id="count-interactive"></span>-->
                    <!--</a>-->
                    <!--<ul class="dropdown-menu">-->
                    <!--<li><ul class="menu" id="unread-interactive"></ul></li>-->
                    <!--<li class="footer" id="no-interactive"><a href="javascript:void(0)">没有未读消息</a></li>-->
                    <!--</ul>-->
                    <!--</li>-->
                    <li shiro:authenticated="true" class="dropdown user user-menu" style="width: 160px!important;">
                        <a href="#" id="account" class="dropdown-toggle" data-toggle="dropdown">
                            <img
                                    th:src="${#strings.isEmpty(session.user.img)}?@{/img/person.png}:${session.user.img}"
                                    onerror="javascript:this.src='/img/person.png'"
                                    id="userImage" class="user-image img-circle"/>
                            <span class="hidden-xs" th:text="${session.user.name}">Alexander Pierce</span>
                        </a>

                        <ul class="dropdown-menu"
                            style="margin:0!important;width: 100px!important;padding: 0!important;">
                            <li style="width: 90px!important;" id="updateSign"><a style="padding: 0px"
                                                                                  href="javascript:void(0)"
                                                                                  class="pull-right"
                                                                                  onclick="js.modal.open('modal-updatePassword')"><i
                                    class="fa fa-edit">&nbsp;修改密码</i></a></li>
                            <li style="width: 90px!important;" id="updatePwd"><a style="padding: 0px"
                                                                                 href="javascript:void(0)"
                                                                                 class="pull-right"
                                                                                 onclick="js.modal.open('modal-upload')"><i
                                    class="fa fa-edit">&nbsp;修改头像</i></a></li>
                        </ul>


                    </li>
                    <li><a th:href="@{/file/辽宁忠旺机械设备制造有限公司物资管理系统操作手册.docx}">帮助文档</a></li>
                    <!--<li><a th:href="@{/help/download}" >帮助文档</a></li>-->
                    <!--<li shiro:authenticated="true"><a href="#" id="updatePassword"-->
                    <!--onclick="js.modal.open('modal-updatePassword')"><i-->
                    <!--class="fa fa-edit">&nbsp;修改密码</i></a></li>-->
                    <!--<li> <a th:href="@{/help}" target="content" ><i class="fa fa-file-word-o">&nbsp;帮助</i></a> </li>-->
                    <li><a th:href="@{/logout}"><i class="fa fa-sign-out">&nbsp;退出</i></a></li>
                </ul>
            </div>
        </nav>
    </header>
    <aside class="main-sidebar">
        <section class="sidebar">
            <ul class="sidebar-menu" data-widget="tree">
                <li shiro:hasPermission="overview:menu" class="treeview menu-open">
                    <a href="#">
                        <i class="fa fa-folder-open text-maroon"></i>
                        <span>系统总览</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu" style="display: block;">
                        <li class="active"><a th:href="@{/overview/index/}" shiro:hasPermission="overview:main:view"
                                              target="content"><i class="fa fa-bar-chart text-orange"></i> 首页</a></li>
                        <li class="active"><a th:href="@{/overview/inventory/index}"
                                              shiro:hasPermission="overview:unionquery:view" target="content"><i
                                class="fa fa-file-text-o text-green"></i> 库存联合查询</a></li>
                        <!--<li class="active"><a th:href="@{/overview/state}" shiro:hasPermission="overview:project:view"-->
                                              <!--target="content"><i class="fa fa-cogs text-blue"></i> 生产状态编辑</a></li>-->
                        <!--<li class="active"><a th:href="@{/overview/matstatus}"-->
                                              <!--shiro:hasPermission="overview:matstatusquery:view"-->
                                              <!--target="content"><i-->
                                <!--class="glyphicon glyphicon-glyphicon glyphicon-search"></i> 物控状态变更查询</a></li>-->
                        <li class="active"><a th:href="@{/overview/statistical}"
                                              shiro:hasPermission="overview:statistical:view" target="content"><i
                                class="fa fa-table text-lime"></i> 统计报表</a></li>
                    </ul>
                </li>

                <li shiro:hasPermission="buy:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-capitalize"></i>
                        <span>采购管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/buy/procurementPlanDashboard/page}" shiro:hasPermission="buy:procurementplandashboard:view"
                               target="content"><i class="fa fa-area-chart text-fuchsia"></i> 采购计划看板</a></li>
                        <li><a th:href="@{/buy/getReportPlanList}" shiro:hasPermission="buy:planreceive:view"
                               target="content"><i class="fa fa-cloud-download text-green"></i> 提报计划接收</a></li>
                        <li><a th:href="@{/buy/preOrderPlan/page}" shiro:hasPermission="buy:preorderplan:view"
                               target="content"><i class="fa fa-list-alt text-orange"></i> 预购计划编辑</a></li>
                        <li><a th:href="@{/buy/preOrderPlanCheck/page}" shiro:hasPermission="buy:preorderplancheck:view"
                               target="content"><i class="fa fa-legal text-capitalize"></i> 预购计划审核</a></li>
                        <li><a th:href="@{/buy/procurementPlan/page}" shiro:hasPermission="buy:procurementplan:view"
                               target="content"><i class="fa fa-edit text-blue"></i> 采购计划编辑</a></li>
<!--                        <li><a th:href="@{/buy/supplementaryReportPlanInput}" shiro:hasPermission="buy:planadd:view"-->
<!--                               target="content"><i class="fa fa-file-text text-warning"></i> 补计划录入</a></li>-->
<!--                        <li><a th:href="@{/buy/getReportPlanList/plannerEdit}"-->
<!--                               shiro:hasPermission="buy:plandistribution:view"-->
<!--                               target="content"><i class="fa fa-file-text text-danger"></i> 提报计划分配</a></li>-->
                        <!--                        <li><a th:href="@{/buy/importReportPlan}" shiro:hasPermission="buy:planimport:view"-->
                        <!--                               target="content"><i class="fa fa-file-text text-warning"></i> 提报计划导入</a></li>-->
<!--                        <li><a th:href="@{/buy/editReportPlan}" shiro:hasPermission="buy:planedit:view"-->
<!--                               target="content"><i class="fa fa-file-text text-yellow"></i> 提报计划编辑</a></li>-->
<!--                        <li><a th:href="@{/buy/planDelCheck}" shiro:hasPermission="buy:plancheck:view"-->
<!--                               target="content"><i class="fa fa-file-text text-capitalize"></i> 计划删除审核</a></li>-->
<!--                        <li><a th:href="@{/buy/editBuyPlan}" shiro:hasPermission="buy:buyedit:view" target="content"><i-->
<!--                                class="fa fa-file-text text-lime"></i> 采购计划编辑</a></li>-->
<!--                        <li><a th:href="@{/buy/buyPlanCheck/采购计划审阅}" shiro:hasPermission="buy:buycheck:view"-->
<!--                               target="content"><i class="fa fa-upload text-warning"></i> 采购计划审阅</a></li>-->
<!--                        <li><a th:href="@{/buy/exportBuyPlan/page}" shiro:hasPermission="buy:buyexport:view"-->
<!--                               target="content"><i class="fa fa-upload text-aqua"></i> 采购计划导出</a></li>-->
<!--                        <li><a th:href="@{/buy/editBuyProgress}" shiro:hasPermission="buy:buyprogress:view"-->
<!--                               target="content"><i class="fa fa-file-text text-blue  "></i> 采购进度编辑</a></li>-->
<!--                        <li><a th:href="@{/buy/integrateQuery}" shiro:hasPermission="buy:buyquery:view"-->
<!--                               target="content"><i class="fa fa-file-text-o text-red   "></i> 采购计划综合查询</a></li>-->
                    </ul>
                </li>
<!--                <li shiro:hasPermission="buychange:menu" class="treeview">-->
<!--                    <a href="#">-->
<!--                        <i class="fa fa-folder-open text-capitalize"></i>-->
<!--                        <span>采购变更管理</span><span class="pull-right-container"><i-->
<!--                            class="fa fa-angle-left pull-right"></i></span>-->
<!--                    </a>-->
<!--                    <ul class="treeview-menu">-->
<!--                        <li><a th:href="@{/plan/change}" shiro:hasPermission="buychange:planchangereceive:view"-->
<!--                               target="content"><i class="fa fa-cloud-download text-yellow"></i> 提报计划变更接收</a></li>-->
<!--                        <li><a th:href="@{/buy/buyPlanChange}" shiro:hasPermission="buy:buychange:view"-->
<!--                               target="content"><i class="fa fa-pencil-square text-red"></i> 采购计划变更</a></li>-->
<!--                        <li><a th:href="@{/plan/changeQuery}" shiro:hasPermission="buychange:planchangequery:view"-->
<!--                               target="content"><i class="fa fa-search text-green"></i> 提报计划变更查询</a></li>-->
<!--                        <li><a th:href="@{/buy/planChangeQuery}" shiro:hasPermission="buy:changequery:view"-->
<!--                               target="content"><i class="fa fa-binoculars text-maroon"></i> 采购计划变更查询</a></li>-->
<!--                    </ul>-->
<!--                </li>-->
<!--                <li shiro:hasPermission="plan:menu" class="treeview">-->
<!--                    <a href="#">-->
<!--                        <i class="fa fa-folder-open text-capitalize"></i>-->
<!--                        <span>追计划管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
<!--                    </a>-->
<!--                    <ul class="treeview-menu">-->
<!--                        &lt;!&ndash;<li><a th:href="@{/buy/}" shiro:hasPermission="plan:buyretconfirm:view" target="content"><i class="fa fa-pencil-square text-orange"></i> 外购件预入库确认</a></li>&ndash;&gt;-->
<!--                        <li><a th:href="@{/buy/outerReturn}" shiro:hasPermission="plan:buyretconfirm:view"-->
<!--                               target="content"><i class="fa fa-pencil-square text-green"></i> 外购件回货确认</a></li>-->
<!--                        <li><a th:href="@{/buy/outsourceReturn}" shiro:hasPermission="plan:outsourceretconfirm:view"-->
<!--                               target="content"><i class="fa fa-pencil-square text-red"></i> 外协件回货确认</a></li>-->
<!--                        <li><a th:href="@{/buy/materialReturn}" shiro:hasPermission="plan:matretconfirm:view"-->
<!--                               target="content"><i class="fa fa-pencil-square text-blue"></i> 原材料回货确认</a></li>-->
<!--                        <li><a th:href="@{buy/planTraManage/index}" shiro:hasPermission="plan:probuydetail:view"-->
<!--                               target="content"><i class="fa fa-search-plus text-olive"></i> 项目采购计划看板</a></li>-->
<!--                        &lt;!&ndash;                        <li><a th:href="@{buy/purchaseCompletionQuery}" shiro:hasPermission="plan:buycompletion:view"&ndash;&gt;-->
<!--                        &lt;!&ndash;                               target="content"><i class="fa fa-search-plus text-olive"></i> 采购完成度查询</a></li>&ndash;&gt;-->
<!--                        &lt;!&ndash;<li><a th:href="@{/integrate/month}" shiro:hasPermission="plan:probuydetail:view" target="content"><i class="fa fa-search-plus text-olive"></i> 项目采购计划明细</a></li>&ndash;&gt;-->
<!--                    </ul>-->
<!--                </li>-->

                <li id="W01" shiro:hasPermission="purwar:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-green"></i>

                        <span>外购件出入库管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/purWarInManage/index/pur}" shiro:hasPermission="purwar:purinwar:view"
                               target="content"><i class="fa fa-pencil-square-o text-capitalize"></i> 采购入库</a></li>
                        <li><a th:href="@{/purWarOutManage/index/pur}" shiro:hasPermission="purwar:puroutwar:view"
                               target="content"><i class="fa fa-share-square-o text-danger"></i> 领料出库</a></li>
                        <!--                        <li><a th:href="@{/purchase/allocationManage/index}"-->
                        <!--                               shiro:hasPermission="purwar:puralloutwar:view"-->
                        <!--                               target="content"><i class="fa fa-sign-out text-olive"></i> 调拨出库</a></li>-->
                        <!--<li><a th:href="@{/half/halWarManage/allocationInWar/page}"-->
                        <!--shiro:hasPermission="halwar:halallinwar:view" target="content"><i-->
                        <!--class="fa fa-link text-olive"></i> 调拨入库</a></li>-->
                        <li><a th:href="@{/purWarQuery/index}" shiro:hasPermission="purwar:purwarquery:view"
                               target="content"><i class="fa fa-file-text-o text-orange"></i> 出入库综合查询</a></li>
                    </ul>
                </li>

                <li shiro:hasPermission="purinv:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-green"></i>
                        <span>外购件库存管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/purInvQuery/index}" shiro:hasPermission="purinv:purinvquery:view"
                               target="content"><i class="fa fa-file-text-o text-teal"></i> 库存综合查询</a></li>
                        <li><a th:href="@{/pInventoryInfoEdit/index}"
                               shiro:hasAnyPermissions="purinv:purinvedit:view,mecinv:mecinvedit:view,ykinv:ykinvedit:view"
                               target="content"><i class="fa fa-file-text text-blue"></i> 库存信息编辑</a></li>
                        <li><a th:href="@{/reverse/index}"
                               shiro:hasAnyPermissions="purinv:purreverse:view,mecinv:purreverse:view,ykinv:purreverse:view"
                               target="content"><i class="fa fa-file-text text-capitalize"></i> 单据冲单</a></li>
                        <li><a th:href="@{/purchase/change/index}" shiro:hasPermission="purinv:purchalist:view"
                               target="content"><i class="fa fa-exclamation-circle text-red"></i> 串料申请</a></li>
                        <li><a th:href="@{/purchase/change/execPage}" shiro:hasPermission="purinv:purexeccha:view"
                               target="content"><i class="fa fa-edit text-aqua"></i> 串料执行</a></li>
                        <li><a th:href="@{/purchase/invPro/index}" shiro:hasPermission="purinv:purwarpro:view"
                               target="content"><i class="fa fa-eyedropper text-green"></i> 库存划项目标记</a></li>
                        <li><a th:href="@{/purchase/invPro/execPage}" shiro:hasPermission="purinv:purwaprorexec:view"
                               target="content"><i class="fa fa-edit text-info"></i> 库存划项目执行</a></li>
                        <li><a th:href="@{/purchase/proInv/index}" shiro:hasPermission="purinv:purprowar:view"
                               target="content"><i class="fa fa-eyedropper text-red"></i> 项目划库存标记</a></li>
                        <li><a th:href="@{/purchase/proInv/execPage}" shiro:hasPermission="purinv:purprowarexec:view"
                               target="content"><i class="fa fa-edit text-yellow"></i> 项目划库存执行</a></li>
                        <li><a th:href="@{/purchase/adjust/index}" shiro:hasPermission="purinv:puradjlist:view"
                               target="content"><i class="fa fa-exclamation-circle text-purple"></i> 库存调整申请</a></li>
                        <li><a th:href="@{/purchase/adjust/review}" shiro:hasPermission="purinv:puradjapp:view"
                               target="content"><i class="fa fa-pencil text-danger"></i> 库存调整审批</a></li>
                        <li><a th:href="@{/purchase/check}" shiro:hasPermission="purinv:purcheckplan:view"
                               target="content"><i class="fa fa-retweet text-sm"></i> 库存盘点</a></li>
                    </ul>
                </li>
                <li id="W02" shiro:hasPermission="mecwar:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-green"></i>

                        <span>机械备件库管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/purWarInManage/index/mec}" shiro:hasPermission="mecwar:inwar:view"
                               target="content"><i class="fa fa-pencil-square-o text-capitalize"></i> 采购入库</a></li>
                        <li><a th:href="@{/purWarOutManage/index/mec}" shiro:hasPermission="mecwar:outwar:view"
                               target="content"><i class="fa fa-share-square-o text-danger"></i> 领料出库</a></li>
                        <!--<li><a th:href="@{/purchase/allocationManage/index}" shiro:hasPermission="purwar:puralloutwar:view"-->
                        <!--target="content"><i class="fa fa-sign-out text-olive"></i> 调拨出库</a></li>-->
                        <!--&lt;!&ndash;<li><a th:href="@{/half/halWarManage/allocationInWar/page}"&ndash;&gt;-->
                        <!--&lt;!&ndash;shiro:hasPermission="halwar:halallinwar:view" target="content"><i&ndash;&gt;-->
                        <!--&lt;!&ndash;class="fa fa-link text-olive"></i> 调拨入库</a></li>&ndash;&gt;-->
                        <!--<li><a th:href="@{/purWarQuery/index}" shiro:hasPermission="purwar:purwarquery:view"-->
                        <!--target="content"><i class="fa fa-file-text-o text-orange"></i> 出入库综合查询</a></li>-->
                    </ul>
                </li>
                <li id="W03" shiro:hasPermission="ykwar:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-green"></i>

                        <span>营口机械备件库管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/purWarInManage/index/yk}" shiro:hasPermission="ykwar:inwar:view"
                               target="content"><i class="fa fa-pencil-square-o text-capitalize"></i> 采购入库</a></li>
                        <li><a th:href="@{/purWarOutManage/index/yk}" shiro:hasPermission="ykwar:outwar:view"
                               target="content"><i class="fa fa-share-square-o text-danger"></i> 领料出库</a></li>
                        <!--<li><a th:href="@{/purchase/allocationManage/index}" shiro:hasPermission="purwar:puralloutwar:view"-->
                        <!--target="content"><i class="fa fa-sign-out text-olive"></i> 调拨出库</a></li>-->
                        <!--&lt;!&ndash;<li><a th:href="@{/half/halWarManage/allocationInWar/page}"&ndash;&gt;-->
                        <!--&lt;!&ndash;shiro:hasPermission="halwar:halallinwar:view" target="content"><i&ndash;&gt;-->
                        <!--&lt;!&ndash;class="fa fa-link text-olive"></i> 调拨入库</a></li>&ndash;&gt;-->
                        <!--<li><a th:href="@{/purWarQuery/index}" shiro:hasPermission="purwar:purwarquery:view"-->
                        <!--target="content"><i class="fa fa-file-text-o text-orange"></i> 出入库综合查询</a></li>-->
                    </ul>
                </li>
                <li shiro:hasPermission="matwar:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-blue"></i>
                        <span>原料出入库管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/material/order/inCreate}" shiro:hasPermission="matwar:matinwar:view"
                               target="content"><i class="fa fa-pencil-square-o text-green"></i> 采购入库</a></li>
                        <li><a th:href="@{/material/order/outCreate}" shiro:hasPermission="matwar:matoutwar:view"
                               target="content"><i class="fa fa-share-square-o text-sm"></i> 领料出库</a></li>
                        <li><a th:href="@{/matWarManage/composite}" shiro:hasPermission="matwar:matwarquery:view"
                               target="content"><i class="fa fa-file-text-o text-orange"></i> 出入库综合查询</a></li>
                    </ul>
                </li>

                <li shiro:hasPermission="matinv:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-blue"></i>
                        <span>原料库存管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/matInvManage/complex/page/kccx}"
                               shiro:hasPermission="matinv:matinvquery:view"
                               target="content"><i class="fa fa-file-text-o text-teal"></i> 库存综合查询</a></li>
                        <li><a th:href="@{/material/inventoryEdit/page}" shiro:hasPermission="matinv:matinvedit:view"
                               target="content"><i class="fa fa-file-text text-blue"></i> 库存信息编辑</a></li>
                        <li><a th:href="@{/material/order/redOrderDetail}" shiro:hasPermission="matinv:matreverse:view"
                               target="content"><i class="fa fa-file-text text-capitalize"></i> 单据冲单</a></li>
                        <li><a th:href="@{/material/changeOrder/page}" shiro:hasPermission="matinv:matchalist:view"
                               target="content"><i class="fa fa-exclamation-circle text-red"></i> 串料申请</a></li>
                        <li><a th:href="@{/material/changeOrder/check}" shiro:hasPermission="matinv:matexeccha:view"
                               target="content"><i class="fa fa-edit text-aqua"></i> 串料执行</a></li>
                        <li><a th:href="@{/material/matInvManage/matRetManage}" shiro:hasPermission="matinv:retMat:view"
                               target="content"><i class="fa fa-edit text-green"></i> 还料提醒</a></li>
                        <li><a th:href="@{/material/ityToPro/page}" shiro:hasPermission="matinv:matwarpro:view"
                               target="content"><i class="fa fa-eyedropper text-green"></i> 库存划项目标记</a></li>
                        <li><a th:href="@{/material/ityToPro/check}" shiro:hasPermission="matinv:matwaprorexec:view"
                               target="content"><i class="fa fa-edit text-info"></i> 库存划项目执行</a></li>
                        <li><a th:href="@{/material/proToIty/page}" shiro:hasPermission="matinv:matprowar:view"
                               target="content"><i class="fa fa-eyedropper text-red"></i> 项目划库存标记</a></li>
                        <li><a th:href="@{/material/proToIty/check}" shiro:hasPermission="matinv:matprowarexec:view"
                               target="content"><i class="fa fa-edit text-yellow"></i> 项目划库存执行</a></li>
                        <li><a th:href="@{/material/matInvManage/rawMatJustApply}"
                               shiro:hasPermission="matinv:matadjlist:view" target="content"><i
                                class="fa fa-exclamation-circle text-purple"></i> 库存调整申请</a></li>
                        <li><a th:href="@{/material/matInvManage/rawMatJusTexaChange}"
                               shiro:hasPermission="matinv:matadjapp:view" target="content"><i
                                class="fa fa-pencil text-danger"></i> 库存调整审批</a></li>
                        <li><a th:href="@{/material/checkPlan/plan}" shiro:hasPermission="matinv:matcheckplan:view"
                               target="content"><i class="fa fa-retweet text-sm"></i> 库存盘点</a></li>
                    </ul>
                </li>

                <li shiro:hasPermission="halwar:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-red"></i>
                        <span>成品出入库管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/half/halWarManage/finishWar/page}"
                               shiro:hasPermission="halwar:halmakeinwar:view" target="content"><i
                                class="fa fa-inbox text-teal"></i> 制作件入库</a></li>
                        <li><a th:href="@{/half/halWarManage/inBuyWar/page}"
                               shiro:hasPermission="halwar:halpurinwar:view" target="content"><i
                                class="fa fa-download text-info"></i> 外协件入库</a></li>
                        <li><a th:href="@{/half/halWarManage/inAluminWar/page}"
                               shiro:hasPermission="halwar:halalinwar:view" target="content"><i
                                class="fa fa-cart-arrow-down text-success"></i> 铝料入库</a></li>
                        <!--<li><a th:href="@{/half/halWarManage/allocationInWar/page}"
                               shiro:hasPermission="halwar:halallinwar:view" target="content"><i
                                class="fa fa-link text-olive"></i> 调拨入库</a></li>-->
                        <li><a th:href="@{/half/halWarManage/outOfFinishWar/page}"
                               shiro:hasPermission="halwar:halmakeoutwar:view" target="content"><i
                                class="fa fa-truck text-sm"></i> 制作件出库</a></li>
                        <li><a th:href="@{/half/halWarManage/outOfBuyWar/page}"
                               shiro:hasPermission="halwar:halpuroutwar:view" target="content"><i
                                class="fa fa-share-square text-red"></i> 外协件出库</a></li>
                        <li><a th:href="@{/half/halWarManage/outOfAluminWar/page}"
                               shiro:hasPermission="halwar:halaloutwar:view" target="content"><i
                                class="fa fa-send text-info"></i> 铝料出库</a></li>
                        <li><a th:href="@{/half/halWarManage/inAndOutQuery/page}"
                               shiro:hasPermission="halwar:halwarquery:view" target="content"><i
                                class="fa fa-file-text-o text-orange"></i> 出入库综合查询</a></li>
                    </ul>
                </li>

                <li shiro:hasPermission="halinv:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-red"></i>
                        <span>成品库存管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/half/halInvManage/inventoryQuery/page}"
                               shiro:hasPermission="halinv:halinvquery:view" target="content"><i
                                class="fa fa-file-text-o text-teal"></i> 库存综合查询</a></li>
                        <li><a th:href="@{/half/halInvManage/InvInfoEdit/page}"
                               shiro:hasPermission="halinv:halinvedit:view" target="content"><i
                                class="fa fa-file-text text-blue"></i> 库存信息编辑</a></li>
                        <li><a th:href="@{/half/halInvManage/redOrderDetail/page}"
                               shiro:hasPermission="halinv:halreverse:view" target="content"><i
                                class="fa fa-file-text text-capitalize"></i> 单据冲单</a></li>
                        <!--<li><a th:href="@{/half/halInvManage/changeApply/page}"
                               shiro:hasPermission="halinv:halchalist:view" target="content"><i
                                class="fa fa-exclamation-circle text-red"></i> 串料申请</a></li>
                        <li><a th:href="@{/half/halInvManage/changeExc/page}"
                               shiro:hasPermission="halinv:halexeccha:view" target="content"><i
                                class="fa fa-file-text-o text-aqua"></i> 串料执行</a></li>-->
                        <li><a th:href="@{/half/halInvManage/invToProMark/page}"
                               shiro:hasPermission="halinv:halwarpro:view" target="content"><i
                                class="fa fa-eyedropper text-green"></i> 库存划项目标记</a></li>
                        <li><a th:href="@{/half/halInvManage/invToProExc/page}"
                               shiro:hasPermission="halinv:halwaprorexec:view" target="content"><i
                                class="fa fa-edit text-info"></i> 库存划项目执行</a></li>
                        <li><a th:href="@{/half/halInvManage/proToInvMark/page}"
                               shiro:hasPermission="halinv:halprowar:view" target="content"><i
                                class="fa fa-eyedropper text-red"></i> 项目划库存标记</a></li>
                        <li><a th:href="@{/half/halInvManage/proToInvExc/page}"
                               shiro:hasPermission="halinv:halprowarexec:view" target="content"><i
                                class="fa fa-edit text-yellow"></i> 项目划库存执行</a></li>
                        <li><a th:href="@{/half/halInvManage/halfInveAdjApply}"
                               shiro:hasPermission="halinv:haladjlist:view" target="content"><i
                                class="fa fa-exclamation-circle text-purple"></i> 库存调整申请</a></li>
                        <li><a th:href="@{/half/halInvManage/halfInveAdjAppr}"
                               shiro:hasPermission="halinv:haladjapp:view" target="content"><i
                                class="fa fa-pencil text-danger"></i> 库存调整审批</a></li>
                        <li><a th:href="@{/half/halInvManage/inventoryCheck/page}"
                               shiro:hasPermission="halinv:halcheckplan:view" target="content"><i
                                class="fa fa-retweet text-sm"></i> 库存盘点</a>
                    </ul>
                </li>
                <!--                <li shiro:hasPermission="drive:sb:menu" class="treeview">-->
                <!--                    <a href="#">-->
                <!--                        <i class="fa fa-folder-open text-purple"></i>-->
                <!--                        <span>设备台账管理</span><span class="pull-right-container"><i-->
                <!--                            class="fa fa-angle-left pull-right"></i></span>-->
                <!--                    </a>-->
                <!--                    <ul class="treeview-menu">-->
                <!--                        <li><a th:href="@{/tool/statistic/page}" shiro:hasPermission="drive:statistics:view"-->
                <!--                               target="content"><i class="fa fa-table text-teal"></i> 台账统计</a></li>-->
                <!--                        <li><a th:href="@{/tool/equipment/page}" shiro:hasPermission="drive:sbtype:view"-->
                <!--                               target="content"><i-->
                <!--                                class="fa fa-file-text text-blue"></i> 设备台账</a></li>-->
                <!--                        <li><a th:href="@{/tool/offEquipment/page}" shiro:hasPermission="drive:officesb:view"-->
                <!--                               target="content"><i class="fa fa-file-text text-capitalize"></i> 办公设备台账</a></li>-->
                <!--                        <li><a th:href="@{/tool/offMater/page}" shiro:hasPermission="drive:officematsb:view"-->
                <!--                               target="content"><i class="fa fa-file-text text-red"></i> 办公物资台账</a></li>-->
                <!--                        <li><a th:href="@{/tool/ku/page}" shiro:hasPermission="drive:toolsb:view" target="content"><i-->
                <!--                                class="fa fa-file-text text-aqua"></i> 工具台账</a></li>-->
                <!--                    </ul>-->
                <!--                </li>-->

                <li shiro:hasPermission="jiagong:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-orange"></i>
                        <span>甲供件库管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <!--外购件-->
                        <li><a th:href="@{/jiaGongInto/page}" shiro:hasPermission="jiagong:storagein:vew"
                               target="content"><i
                                class="fa fa-calendar text-sm"></i> 甲供件-外购件采购入库</a></li>
                        <li><a th:href="@{/jiaGongOut/page}" shiro:hasPermission="jiagong:storageout:vew"
                               target="content"><i
                                class="fa fa-check-square text-red"></i> 甲供件-外购件领料出库</a></li>
                        <li><a th:href="@{/jiaGongStockQuery/page}" shiro:hasPermission="jiagong:storagestock:vew"
                               target="content"><i
                                class="fa fa-tags text-yellow"></i> 甲供件-外购件库存查询</a></li>
                        <li><a th:href="@{/jiaGongAccountQuery/page}" shiro:hasPermission="jiagong:storagesaccount:vew"
                               target="content"><i
                                class="fa fa-briefcase text-blue"></i> 甲供件-外购件出入库综合查询</a></li>
                        <li><a th:href="@{/jiaGongOffset/page}" shiro:hasPermission="jiagong:storageoffset:vew"
                               target="content"><i
                                class="fa fa-file-text-o text-green"></i> 甲供件-外购件冲单</a></li>
                        <!--原料-->
                        <li><a th:href="@{/materialInto/pageIn}" shiro:hasPermission="jiagong:materialin:vew"
                               target="content"><i
                                class="fa fa-calendar text-sm"></i> 甲供件-原材料采购入库</a></li>
                        <li><a th:href="@{/materialInto/pageOut}" shiro:hasPermission="jiagong:materialout:vew"
                               target="content"><i
                                class="fa fa-check-square text-red"></i> 甲供件-原材料领料出库</a></li>
                        <li><a th:href="@{/materialStockQuery/page/kccx}" shiro:hasPermission="jiagong:materialstock:vew"
                               target="content"><i
                                class="fa fa-tags text-yellow"></i> 甲供件-原材料库存查询</a></li>
                        <li><a th:href="@{/materialAccountQuery/page}" shiro:hasPermission="jiagong:materialaccount:vew"
                               target="content"><i
                                class="fa fa-briefcase text-blue"></i> 甲供件-原材料出入库综合查询</a></li>
                        <li><a th:href="@{/materialOffset/page}" shiro:hasPermission="jiagong:materialoffset:vew"
                               target="content"><i
                                class="fa fa-file-text-o text-green"></i> 甲供件-原材料冲单</a></li>
                        <!--毛坯库与铝料-->
                        <li><a th:href="@{/semiInto/page}" shiro:hasPermission="jiagong:semiin:vew"
                               target="content"><i
                                class="fa fa-calendar text-sm"></i> 甲供件-毛坯库采购入库</a></li>
                        <li><a th:href="@{/semiOut/page}" shiro:hasPermission="jiagong:semiout:vew"
                               target="content"><i
                                class="fa fa-check-square text-red"></i> 甲供件-毛坯库领料出库</a></li>
                        <li><a th:href="@{/aluminiumIn/page}" shiro:hasPermission="jiagong:aluiminumin:vew"
                               target="content"><i
                                class="fa fa-calendar text-sm"></i> 甲供件-铝料采购入库</a></li>
                        <li><a th:href="@{/aluminiumOut/page}" shiro:hasPermission="jiagong:aluiminumout:vew"
                               target="content"><i
                                class="fa fa-check-square text-red"></i> 甲供件-铝料领料出库</a></li>
                        <li><a th:href="@{/stockQuery/page}" shiro:hasPermission="jiagong:semiandaluiminumstock:vew"
                               target="content"><i
                                class="fa fa-tags text-yellow"></i> 甲供件-毛坯与铝料库存查询</a></li>
                        <li><a th:href="@{/accountQuery/page}" shiro:hasPermission="jiagong:semiandaluiminumaccount:vew"
                               target="content"><i
                                class="fa fa-briefcase text-blue"></i> 甲供件-毛坯与铝料出入库综合查询</a></li>
                        <li><a th:href="@{/offset/page}" shiro:hasPermission="jiagong:semiandaluiminumoffset:vew"
                               target="content"><i
                                class="fa fa-file-text-o text-green"></i> 甲供件-毛坯与铝料冲单</a></li>
                    </ul>
                </li>


                <li shiro:hasPermission="allocation:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-orange"></i>
                        <span>调拨管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/allocationOrder/page}" shiro:hasPermission="allocation:order:vew"
                               target="content"><i
                                class="fa fa-calendar text-sm"></i> 调拨单计划</a></li>
                        <li><a th:href="@{/allocationCheck/page}" shiro:hasPermission="allocation:orderapp:vew"
                               target="content"><i
                                class="fa fa-check-square text-red"></i> 调拨单审核</a></li>
                        <li><a th:href="@{/allocationOutWar/page}" shiro:hasPermission="allocation:out:view"
                               target="content"><i
                                class="fa fa-tags text-yellow"></i> 调拨出库</a></li>
                        <li><a th:href="@{/allocationInWar/page}" shiro:hasPermission="allocation:in:view"
                               target="content"><i class="fa fa-briefcase text-blue"></i> 调拨入库</a></li>
                        <li><a th:href="@{/allocationQuery/page}" shiro:hasPermission="allocation:query:view"
                               target="content"><i
                                class="fa fa-file-text-o text-green"></i> 调拨明细查询</a></li>
                    </ul>
                </li>
                <li shiro:hasPermission="basic:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-orange"></i>
                        <span>基础信息配置</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/basic/materials/page}" shiro:hasPermission="basic:matinfo:view"
                               target="content"><i class="fa fa-th-large text-blue"></i> 物料信息维护</a></li>
                        <li><a th:href="@{/basic/materialdictionary/page}" shiro:hasPermission="basic:rawmatinfo:view"
                               target="content"><i class="fa fa-th-large text-blue"></i> 原料数据字典维护</a></li>
                        <li><a th:href="@{/basic/warehouse/page}" shiro:hasPermission="basic:warehouse:view"
                               target="content"><i class="fa fa-th-list text-green"></i> 仓库区位维护</a></li>
                        <li><a th:href="@{/basic/dept/page}" shiro:hasPermission="basic:dept:view" target="content"><i
                                class="fa fa-list-alt text-purple"></i> 部门维护</a></li>
                        <li><a th:href="@{/basic/dictionary/page}" shiro:hasPermission="basic:info:view"
                               target="content"><i class="fa fa-list-alt text-capitalize"></i> 物料类别维护</a></li>
                        <!--                        <li><a th:href="@{/tool/equipmentType/page}" shiro:hasPermission="drive:sbtype:view"-->
                        <!--                               target="content"><i class="fa fa-edit text-orange"></i> 台账类型维护</a></li>-->
                        <li><a th:href="@{/basic/employ/page}" shiro:hasPermission="basic:employ:view" target="content"><i
                                class="fa fa-list-alt text-blue"></i> 物控员维护</a></li>
                        <li><a th:href="@{/basic/cost/page}" shiro:hasPermission="basic:cost:view" target="content"><i
                                class="fa  fa-cog text-red"></i> 成本中心维护</a></li>
                        <li>
                            <a th:href="@{/basic/verify/page}" shiro:hasPermission="basic:verify:view" target="content">
                                <i class="fa fa-check-square text-yellow"></i> 审核配置
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/basic/org/page}" shiro:hasPermission="basic:org:view" target="content">
                                <i class="fa fa-users text-red"></i> 审核组织架构
                            </a>
                        </li>
                    </ul>
                </li>

                <li shiro:hasPermission="system:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-orange"></i>
                        <span>系统管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a th:href="@{/sys/user}" shiro:hasPermission="system:user:view" target="content"><i
                                class="fa fa-odnoklassniki-square text-red"></i> 帐号管理</a></li>
                        <li><a th:href="@{/sys/role}" shiro:hasPermission="system:role:view" target="content"><i
                                class="fa fa-tags text-yellow"></i> 角色管理</a></li>
                        <li><a th:href="@{/sys/permission}" shiro:hasPermission="system:permissions:view"
                               target="content"><i class="fa fa-briefcase text-blue"></i> 权限管理</a></li>
                        <li><a th:href="@{/sys/log}" shiro:hasPermission="system:log:view" target="content"><i
                                class="fa fa-book text-green"></i> 操作日志</a></li>
                    </ul>
                </li>

            </ul>
        </section>
    </aside>

    <div class="content-wrapper">
        <iframe id="content" th:src="@{/overview/index/}" scrolling="auto" frameborder="0" name="content" width="100%"
                height="100%"></iframe>
    </div>
</div>

<div th:include="include :: footer"></div>
<script th:inline="javascript">


    /** 获取当前登录用户名 */
    function getUserName() {
        $.post(ctx + 'getLoginUserName',
            {},
            function (result) {
                $("#user_name").html(result.data);
            }, 'json')
    }

    /** 如果首页不在最顶层， 将最顶层改为首页 */
    if (window.parent.window !== window) {
        window.top.location = ctx;
    }

    /** 修改iframe框架高度 */
    function changeFrameHeight() {
        var ifm = document.getElementById("content");
        ifm.height = document.documentElement.clientHeight - 56;
    }

    /** 窗口大小改变事件 */
    window.onresize = function () {
        changeFrameHeight();
    };

    // /** 获取下任务消息 */
    // function getSend() {
    //     $("#unread-send").html('');
    //     $("#count-send").html('');
    //     $("#no-send").show();
    //     js.get({
    //         url: ctx + "send",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-send").hide();
    //                 $("#count-send").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = ctx + "img/avatar.png";
    //                     $("#unread-send").append(`
    //                         <li><a class="message-send" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>系统通知<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }
    //
    // /** 获取下任务消息 */
    // function getChange() {
    //     $("#unread-change").html('');
    //     $("#count-change").html('');
    //     $("#no-change").show();
    //     js.get({
    //         url: ctx + "change",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-change").hide();
    //                 $("#count-change").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = ctx + "img/avatar.png";
    //                     $("#unread-change").append(`
    //                         <li><a class="message-change" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>系统通知<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }

    // /**
    //  * 获取互动消息
    //  */
    // function getInteractive() {
    //     $("#unread-interactive").html('');
    //     $("#count-interactive").html('');
    //     $("#no-interactive").show();
    //     js.get({
    //         url: ctx + "receiver",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-interactive").hide();
    //                 $("#count-interactive").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = v.sendUserImage == null ? (ctx + "img/avatar.png") : v.sendUserImage;
    //                     $("#unread-interactive").append(`
    //                         <li><a class="message-interactive" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>${v.sendUserName}<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }

    // /**控制菜单显示*/
    // function roleControllerMenu() {
    //     var roles = [[${roleCodes}]];
    //     $("#W01").hide();
    //     $("#W02").hide();
    //     $("#W03").hide();
    //     var wcount=0;
    //     for (var i = 0; i < roles.length; i++) {
    //         if (roles[i] == "W01") {
    //             $("#W01").show();
    //             wcount++;
    //         }else
    //         if (roles[i] == "W02") {
    //             $("#W02").show();
    //             wcount++;
    //         }else
    //         if (roles[i] == "W03") {
    //             $("#W03").show();
    //             wcount++;
    //         }
    //     }
    //     if(wcount==0){
    //         $("#W01").show();
    //         $("#W02").show();
    //         $("#W03").show();
    //     }
    //
    //
    // }

    $(function () {
        // roleControllerMenu();

        /** 获取当前登录用户名 */
        getUserName();
        /** iframe 自动高度 */
        changeFrameHeight();

        /** 验证初始化 */
        js.validate.init("userForm", {
            fields: {
                password: {validators: {notEmpty: {message: '请输入密码'}}},
                rePassword: {
                    validators: {
                        notEmpty: {message: '请确认密码'},
                        identical: {field: 'password', message: '两次密码不一致'}
                    }
                }
            }
        });

        /** 修改密码 */
        $("#btn-updatePassword").click(function () {
            if (js.validate.isValid("userForm")) {
                js.post({
                    url: ctx + "update/user/pwd",
                    data: $("#userForm").serialize(),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.modal.hide("modal-updatePassword");
                        } else {
                            js.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    }
                });
            }
        });


        /** 菜单栏点击事件 */
        $(".treeview-menu>li").click(function () {
            $(".treeview-menu>li").removeClass("active");
            $(this).addClass("active");
        });

        // /** 初始化WebSocket */
        // js.ws.init({
        //     // url: "ws://192.168.72.158:8080/websocket",
        //     url: "ws://192.168.50.1:8081/websocket",
        //     handler: function (msg) {
        //         if (msg.data === "INTERACTIVE") {
        //             getInteractive();
        //         } else if (msg.data === "SEND") {
        //             getSend();
        //         } else if (msg.data === "CHANGE") {
        //             getChange();
        //         }
        //     }
        // });

        /** 获取互动消息 */
        // getInteractive();

        /** 获取下任务消息 */
        // getSend();

        /** 获取项目变更消息 */
        // getChange();

        // /** 互动消息点击 */
        // $(document).on('click', ".message-interactive", function () {
        //     var count = parseInt($("#count-interactive").text());
        //     if (count > 1) {
        //         $("#count-interactive").text(count - 1);
        //     } else {
        //         $("#count-interactive").text('');
        //     }
        //     $(this).parent().remove();
        // });

        // /** 下任务点击 */
        // $(document).on('click', ".message-send", function () {
        //     var count = parseInt($("#count-send").text());
        //     if (count > 1) {
        //         $("#count-send").text(count - 1);
        //     } else {
        //         $("#count-send").text('');
        //     }
        //     $(this).parent().remove();
        // });
        //
        // /** 下任务点击 */
        // $(document).on('click', ".message-change", function () {
        //     var count = parseInt($("#count-change").text());
        //     if (count > 1) {
        //         $("#count-change").text(count - 1);
        //     } else {
        //         $("#count-change").text('');
        //     }
        //     $(this).parent().remove();
        // });


        initCropperInModal($('#photo'), $('#photoInput'), $('#modal-upload'));
        initCropperInModalSign($('#signImg'), $('#signInput'), $('#modal-sign'));


    });

    var initCropperInModal = function (img, input, modal) {
        var $image = img;
        var $inputImage = input;
        var $modal = modal;
        var options = {
            aspectRatio: 1, // 纵横比
            viewMode: 2,
            preview: '.img-preview' // 预览图的class名
        };
        // 模态框隐藏后需要保存的数据对象
        var saveData = {};
        var URL = window.URL || window.webkitURL;
        var blobURL;
        $modal.on('show.bs.modal', function () {
            // 如果打开模态框时没有选择文件就点击“打开图片”按钮
            if (!$inputImage.val()) {
                $inputImage.click();
            }
        }).on('shown.bs.modal', function () {
            // 重新创建
            $image.cropper($.extend(options, {
                ready: function () {
                    // 当剪切界面就绪后，恢复数据
                    if (saveData.canvasData) {
                        $image.cropper('setCanvasData', saveData.canvasData);
                        $image.cropper('setCropBoxData', saveData.cropBoxData);
                    }
                }
            }));
        }).on('hidden.bs.modal', function () {
            // 保存相关数据
            saveData.cropBoxData = $image.cropper('getCropBoxData');
            saveData.canvasData = $image.cropper('getCanvasData');
            // 销毁并将图片保存在img标签
            $image.cropper('destroy').attr('src', blobURL);
        });
        if (URL) {
            $inputImage.change(function () {
                var files = this.files;
                var file;
                if (!$image.data('cropper')) {
                    return;
                }
                if (files && files.length) {
                    file = files[0];
                    if (/^image\/\w+$/.test(file.type)) {

                        if (blobURL) {
                            URL.revokeObjectURL(blobURL);
                        }
                        blobURL = URL.createObjectURL(file);

                        // 重置cropper，将图像替换
                        $image.cropper('reset').cropper('replace', blobURL);

                        // 选择文件后，显示和隐藏相关内容
                        $('.img-container').removeClass('hidden');
                        $('.img-preview-box').removeClass('hidden');
                        $('#btn-upload').removeAttr('disabled').removeClass('disabled');
                        $('.tip-info').addClass('hidden');

                    } else {
                        window.alert('请选择一个图像文件！');
                    }
                }
            });
        } else {
            $inputImage.prop('disabled', true).addClass('disabled');
        }
    }

    var initCropperInModalSign = function (img, input, modal) {
        var $image = img;
        var $inputImage = input;
        var $modal = modal;
        var options = {
            aspectRatio: 3 / 1, // 纵横比
            viewMode: 2/*,
    preview: '.img-preview' // 预览图的class名*/
        };
        // 模态框隐藏后需要保存的数据对象
        var saveData = {};
        var URL = window.URL || window.webkitURL;
        var blobURL;
        $modal.on('show.bs.modal', function () {
            // 如果打开模态框时没有选择文件就点击“打开图片”按钮
            if (!$inputImage.val()) {
                $inputImage.click();
            }
        }).on('shown.bs.modal', function () {
            // 重新创建
            $image.cropper($.extend(options, {
                ready: function () {
                    // 当剪切界面就绪后，恢复数据
                    if (saveData.canvasData) {
                        $image.cropper('setCanvasData', saveData.canvasData);
                        $image.cropper('setCropBoxData', saveData.cropBoxData);
                    }
                }
            }));
        }).on('hidden.bs.modal', function () {
            // 保存相关数据
            saveData.cropBoxData = $image.cropper('getCropBoxData');
            saveData.canvasData = $image.cropper('getCanvasData');
            // 销毁并将图片保存在img标签
            $image.cropper('destroy').attr('src', blobURL);
        });
        if (URL) {
            $inputImage.change(function () {
                var files = this.files;
                var file;
                if (!$image.data('cropper')) {
                    return;
                }
                if (files && files.length) {
                    file = files[0];
                    if (/^image\/\w+$/.test(file.type)) {

                        if (blobURL) {
                            URL.revokeObjectURL(blobURL);
                        }
                        blobURL = URL.createObjectURL(file);

                        // 重置cropper，将图像替换
                        $image.cropper('reset').cropper('replace', blobURL);

                        // 选择文件后，显示和隐藏相关内容
                        $('.sign-img-container').removeClass('hidden');
                        // $('.img-preview-box').removeClass('hidden');
                        $('#btn-sign').removeAttr('disabled').removeClass('disabled');
                        $('.sign-tip-info').addClass('hidden');

                    } else {
                        window.alert('请选择一个图像文件！');
                    }
                }
            });
        } else {
            $inputImage.prop('disabled', true).addClass('disabled');
        }
    }
    /**上传头像*/
    var sendPhoto = function () {
        var photo = $('#photo').cropper('getCroppedCanvas', {
            width: 300,
            height: 300
        }).toDataURL('image/png');

        $.post(ctx + "sys/user/edit/img", {imageData: photo}, function (result) {
            $('#userImage').attr('src', result.data);
            js.modal.hide("modal-upload");
        });
    }


</script>
</body>
</html>
